package littlecyberwar.util;

import java.util.*;

public class Dice {

  private static Random rnd;
  static {
    rnd = new Random(System.currentTimeMillis());
  }

  public static int getRoll( int face ) {
    int val = Math.abs(rnd.nextInt()) % face + 1;
    return ( val );
  }

  /**
   * return multiple die roll results based on n
   * Returns a Vector of Integer objects
   */
  public static Vector getRolls( int face, int n ) {
    Vector v = new Vector();
    for ( int i=0; i < n; i++ ) {
      int val = getRoll( face );
      v.addElement(new Integer(val) );
    }
    return ( v );
  }
}